package com.aotain.hbase;

import java.io.IOException;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;

public class HbaseUtil {

	private String _zooServer = "192.168.5.95";
	
	private Connection connection ;
	
	public HbaseUtil() {}
	
	public HbaseUtil(String _zooServer) {
		this._zooServer = _zooServer;
	}
	
	public void InitConnection() {
		Configuration hConfig = HBaseConfiguration.create();
        hConfig.set("hbase.zookeeper.quorum", _zooServer);
        hConfig.set("hbase.zookeeper.property.clientPort","2181");
        
        try {
			connection = ConnectionFactory.createConnection();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
